//
//  SHD_TagCollectionCell.m
//  B段项目
//
//  Created by dllo on 15/11/6.
//  Copyright © 2015年 谢美娜. All rights reserved.
//

#import "SHD_TagCollectionCell.h"
#import "UIImage+GIF.h"
@implementation SHD_TagCollectionCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _midImageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_midImageView];
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 40 * FitHeight, 120 * FitWidth, 28 * FitHeight)];
        _nuberLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, _titleLabel.frame.size.height + _titleLabel.frame.origin.y, 120 * FitWidth, 12 * FitHeight)];
        _label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 120 * FitWidth, 120 * FitHeight)];
               [_midImageView addSubview:_label];
        [_midImageView addSubview:_titleLabel];
        [_midImageView addSubview:_nuberLabel];
        
    }
    return self ;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _midImageView.frame = self.contentView.frame ;
}
-(void)setTagList:(SHD_TagList *)tagList
{
    _tagList = tagList;
    _nuberLabel.text = [NSString stringWithFormat:@"%@条", tagList.count];
    _titleLabel.text = tagList.Tag;
    _nuberLabel.textAlignment = 1;
    _nuberLabel.textColor = [UIColor whiteColor];
    _titleLabel.textAlignment = 1;
    _titleLabel.textColor = [UIColor whiteColor];
    _nuberLabel.font = [UIFont systemFontOfSize:10 * FitWidth];
    _label.backgroundColor = [UIColor colorWithHue:0 saturation:0 brightness:0 alpha:.5];
//    [_midImageView sd_cancelCurrentImageLoad];
//  [_midImageView sd_setImageWithURL:<#(NSURL *)#> placeholderImage:<#(UIImage *)#> options:<#(SDWebImageOptions)#> progress:<#^(NSInteger receivedSize, NSInteger expectedSize)progressBlock#> completed:<#^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL)completedBlock#>]
    
    _midImageView.contentMode = UIViewContentModeScaleAspectFill;
    _midImageView.clipsToBounds = YES;
   [_midImageView sd_setImageWithURL:[NSURL URLWithString:tagList.img] placeholderImage:[UIImage sd_animatedGIFNamed:@"占位"]];
    
  
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
